
#include "unit_test.h"
#include <iostream>

void main(int argc, char *argv[])
{
	for (int i = 1; i < argc; i++) 
	{
		if (!stricmp(argv[i], "-unit")) {
			solver::unit_tests::test_problem_factory();
		}
		else if (!stricmp(argv[i], "-help")) {
			std::cout << "oversatc options files" << std::endl;
			std::cout << "-unit - run unit tests" << std::endl;
			std::cout << "-help - this message" << std::endl;
			std::cout << "files - one or more files or file patterns" << std::endl;
		}
		else 
		{
			std::cout << "solving:" << argv[i] << std::endl;
			try 
			{
				solver::file_data file_contents(argv[i]);
				sat::cnf_sat_solver solver;
				solver.solve(file_contents, true);
			}
			catch (...)
			{
				std::cerr << "problem solving:" << argv[i] << std::endl;
			}
		}
	}
}
